
	import java.awt.Rectangle;
	import java.awt.event.ActionEvent;
	import java.awt.event.ActionListener;

	import javax.swing.JButton;
	import javax.swing.JFrame;
	import javax.swing.JLabel;
	import javax.swing.JPanel;
/**
 * 
 * this class is ManagerUI gui
 *
 */
	public class ManagerUI  extends JPanel {
		/**
		 * title for the current window  
		 */
		private JLabel lbltitle = null;
		/**
		 * get data button 
		 */
		private JButton btnGetData;
		/**
		 * handle exception button 
		 */
		private JButton btnHandleEx;
		/**
		 * back button 
		 */
		public JButton btnBack = null;
		/**
		 * help button 
		 */
		public JButton btnHelp = null;
		/**
		 * save the current panel for the "back" function 
		 */
		private JPanel curPanel;

		
		
		public ManagerUI () {
			super();
			initialize();
		}

		private void initialize() {
			curPanel = this;
			btnGetData = new JButton();
			btnGetData.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
					DataUI Data = new DataUI();
					setVisible(false);
					System.out.println("Open new sem");
					Global.main.setContentPane(Data);
					Data.btnBack.addActionListener(new ActionListener() {   //back from DataUI
						public void actionPerformed(ActionEvent arg0) {
							Global.main.setContentPane(curPanel);
							curPanel.setVisible(true);
						}
					});
				}
			});
			
			btnGetData.setBounds(new Rectangle(143, 92, 187, 25));
			btnGetData.setText("Get Data");
			this.add(btnGetData,null);
			this.setVisible(true);
			
			btnHandleEx = new JButton();
			btnHandleEx.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent arg0) {
					HandleExUI Handle = new HandleExUI();
					setVisible(false);
					System.out.println("Handle exceptions by manager");
					Global.main.setContentPane(Handle);
					Handle.btnBack.addActionListener(new ActionListener() {   //back from HandleEx UI
						public void actionPerformed(ActionEvent arg0) {
							Global.main.setContentPane(curPanel);
							curPanel.setVisible(true);
						}
					});
				}
			});
			btnHandleEx.setBounds(new Rectangle(143, 162, 187, 25));
			btnHandleEx.setText("Handle Exceptions");
			this.add(btnHandleEx,null);
			this.setVisible(true);
			this.setVisible(true);

			lbltitle = new JLabel("Manager window");
			lbltitle.setBounds(193, 28, 110, 14);

			this.setSize(400, 321);
			this.setLayout(null);
			
			this.add(lbltitle);
		
			btnBack = new JButton("Back");
			btnBack.setBounds(197, 254, 86, 25);
			this.add(btnBack,null);
			this.setVisible(true);
			
			btnHelp = new JButton("Help");
			btnHelp.setBounds(390, 11, 80, 19);
			btnHelp.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					  HelpWin help = new HelpWin ("Click on one of the option");
					  System.out.println("user press Help button");
				}
			});
			this.add(btnHelp,null);
			this.setVisible(true);
			
		}
				
				
	}

